package Categories;

use strict;
use warnings;

sub new {
	my $class = shift;
	my $self = { @_ };
	my $categories_source_name = $self->{Categories_Source_Name};
	
	eval "require IMBK::Data::Source::$categories_source_name";
	
	$self->{Categories_Source} = $categories_source_name->new(%$self);
	
	return bless $self, $class;
};

sub get_categories {
	my $self = shift;
	my $categories_source = $self->{Categories_Source};
	my %hash;
	%hash = $categories_source->get_categories(@_) if ( defined $categories_source );
	return %hash;
};

1;